package com.nf.action;

import com.nf.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class TestAction {

    @Autowired
    private TestService cte;

//    public void setTestService(TestService testService) {
//        System.out.println("第2步：在TestAction中注入一个service");
//        this.testService = testService;
//    }

    public TestAction(){
        System.out.println("第1步：TestAction 创建了实例:"+this);
    }

    @RequestMapping("/abcd")
    public String aa(){
        System.out.println("testService:"+cte);
        System.out.println("第3步：使用TestAction.aa（）");
        return "t1";
    }
}
